function Address(){
    let date = {
        "广东省":{
            "广州市":["白云区","从化区","番禺区","黄浦区","花都区","珠海区"],
            "深圳市":["宝安区","福田区","光明区","罗湖区","龙岗区","龙华区"],
            "佛山市":["禅城区","高明区","南海区","顺德区","三水区"],
            "珠海市":["香洲区","金湾区","斗门区"],
            "汕头市":["湖南区","湖阳区","澄海区","濠江区","金平区","龙湖区"],
        },
        "广西省":{
            "南宁市":["江南区","邕宁区","乡塘区","西黄浦区","兴宁区","武鸣区"],
            "柳州市":["城中区","柳北区","柳江区","柳南区","鱼峰区"],
            "来宾市":["兴宾区","合山市","武宣县","象州县"],
            "桂林市":["叠彩区","临桂区","七星区","秀峰区","雁山区","象山区"],
            "贵港市":["港北区","港南区","桂平市","覃塘区"],
        },
        "江西省":{
            "南昌市":["昌北区","东湖区","高新区","南昌县","西湖区","新建区"],
            "吉安市":["吉州区","吉安县","井冈山市","万安县","青原区","永丰县"],
            "赣州市":["石城县","龙南市","定南县","赣县区","会昌县"],
            "上饶市":["广丰区","德兴市","兴洲区"],
            "九江市":["柴桑区","德安县","都昌县","湖口县","武宁县","永修县"],
        },
        "湖南省":{
            "长沙市":["长沙县","芙蓉区","开福区","天心区","望城区","雨花区"],
            "株洲市":["石峰区","荷塘区","芦淞区","天元区","攸县","渌口区"],
            "湘潭市":["韶山市","湘潭县","湘乡市","岳塘区","雨湖区"],
            "衡阳市":["石鼓区","衡东县","衡南县","衡山县","衡阳县","耒阳市"],
            "昭阳市":["北塔区","城步县","大祥区","洞口县","隆回县"],
        },
        "湖北省":{
            "武汉市":["蔡甸区","东西湖区","黄陂区","汉南区","汉阳区","洪山区"],
            "黄石市":["宝安区","福田区","光明区","罗湖区","龙岗区","龙华区"],
            "荆州市":["公安县","荆州区","沙市区","洪湖市","松滋市"],
            "襄阳市":["保康县","樊城区","谷城县","老河口市","襄城区"],
            "十堰市":["丹江口市","房县","茅箭区","郧阳区","郧西县","竹山县"],
        },
        "海南省":{
            "三亚市":["海棠区","吉阳区","天涯区","崖州区"],
            "文昌市":["抱罗镇","重兴镇","昌洒镇","东阁镇","东郊镇","东路镇"],
            "五指山市":["畅好乡","番阳镇","毛道乡","毛阳镇","南圣镇"],
            "海口市":["龙华区","美兰区","琼山区","秀英区"],
            "琼海市":["博鳌镇","长坡镇","塔洋镇","大路镇","石壁镇"],
        },
        "贵州省":{
            "贵阳市":["白云区","观山湖区","花溪区","开阳县","南明区","清镇市"],
            "六盘水市":["六枝特区","盘州市","水城区","钟山区"],
            "遵义市":["播州区","高明区","凤冈县","红花岗区"],
            "铜仁市":["碧江区","石阡县","德江县","江口县"],
            "毕节市":["大方县","赫章县","金沙县","纳雍县"],
        },
        "云南省":{
            "昆明市":["呈贡区","石林彝族自治县","东川区","富民县","官渡区","晋宁区"],
            "曲靖市":["富源县","会泽县","陆良县","罗平县","马龙区","麒麟区"],
            "玉溪市":["澄江市","红塔区","华宁县","江川区"],
            "昭通市":["大关县","鲁甸县","巧家县","水富市","绥江县","威信县"],
        },
        "福建省":{
            "福州市":["长乐区","仓山区","福清市","鼓楼区","晋安区","连江县"],
            "厦门市":["湖里区","海沧区","集美区","思明区","同安区","翔安区"],
            "三明市":["大田县","建宁县","将乐县","明溪县","宁化县"],
            "莆田市":["城厢区","涵江区","荔城区","秀屿区","仙游县"],
            "泉州市":["石狮市","德化县","丰泽区","惠安县","晋江市","金门县"],
        },
        "浙江省":{
            "宁波市":["北仑区","慈溪市奉化区","高新科技开发区","海曙区","江北区"],
            "衢州市":["常山县","江山市","开化县","柯城区","龙游县","衢江区"],
            "杭州市":["滨江区","淳安县","富阳区","拱墅区","临安区"],
            "温州市":["苍南县","洞头区","龙湾区"],
            "丽水市":["缙云县","莲都区","龙泉市","庆元县","青田县","遂昌县","松阳县"],
        },
    };

    let ProvinceSelect = document.getElementById("province");
    let CitySelect = document.getElementById("city");
    let AreaSelect = document.getElementById("area");

    function fillProvinces(){
        for (let province in date)
        {
            let option = document.createElement('option');
            option.value = province;
            option.textContent = province;
            ProvinceSelect.appendChild(option);
        }
    }

    function updateCity(){
        let province = ProvinceSelect.value;
        CitySelect.innerHTML = '<option value="">请选择市</option>';
        AreaSelect.innerHTML = '<option value="">请选择区</option>';

        if (province && date[province]){
            let cities = date[province];
            for (let city in cities){
                let  option = document.createElement('option');
                option.value = city;
                option.textContent = city;
                CitySelect.appendChild(option);
            }
        }
    }

    function updateDistricts(){
        const province = ProvinceSelect.value;
        const city = CitySelect.value;
        AreaSelect.innerHTML = '<option value="">请选择区</option>';

        if (province && city && date[province] && date[province][city]) {
            const districts = date[province][city];
            for (let district of districts) {
                const option = document.createElement('option');
                option.value = district;
                option.textContent = district;
                AreaSelect.appendChild(option);
            }
        }
    }

    fillProvinces();
    ProvinceSelect.addEventListener('change', updateCity);
    CitySelect.addEventListener('change', updateDistricts);
}
Address();


var src = "http://localhost:63342/used-house/web/";
$("#collect").click(function () {
if($("#img_coll").prop("src") === src+"image/%E6%94%B6%E8%97%8F.png") {
        $("#img_coll").prop("src","image/收藏(黄).png");
}else{
        $("#img_coll").prop("src","image/收藏.png");
}
});